import sys
import os

sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from mysql.mysql_conncet import ReadFromMysql
from config import *


mysql = ReadFromMysql(mysqlhost_awstest, user_awstest, password_awstest, 36033)

if __name__ == '__main__':
    mysql.makepool(database_awstest)

    last_quan = mysql.read_from_mysql("select quantity from fridge_bigdata.fridge_warn_info where id = 1")[0]['quantity']

    print(last_quan)

    rs = mysql.read_from_mysql(f"update fridge_bigdata.fridge_warn_info set quantity=15,yoy_quantity={last_quan},qoq_quantity={last_quan}  where id = 1")
    print(rs)